﻿$(function () {
    var dates = $("#date_dbt, #date_fin").datetimepicker({
        dateFormat: 'yy-mm-dd',
        minDate: new Date(),
        defaultDate: "+1w",
        changeMonth: true,
        onSelect: function( selectedDate ) {
				var option = this.id == "date_dbt" ? "minDate" : "maxDate",
					instance = $( this ).data( "datepicker" ),
					date = $.datepicker.parseDate(
						instance.settings.dateFormat ||
						$.datepicker._defaults.dateFormat,
						selectedDate, instance.settings );
				dates.not( this ).datepicker( "option", option, date );
        }
    });
});